In [1]:
import pandas as pd
import plotly.graph_objects as go
In [2]:
def plot(df3):
# Create the plot
fig = go.Figure()
# Add a scatter trace
fig.add_trace(go.Scatter(
x=df3['date'],
y=df3['TVLMC'],
mode='lines',
name='TVLMC', # Legend name
))
# Update layout with centered title and axis labels
fig.update_layout(
title={
'text': "Ethereum TVLMC",
'x': 0.5, # Center the title horizontally
'y': 0.95, # Position it near the top vertically
'xanchor': 'center', # Anchor to center
'yanchor': 'top' # Anchor to top
},
xaxis_title='Date',
yaxis_title='TVLMC',
legend_title_text='Legend',
)
# Show the figure
fig.show()
return
In [3]:
df3 = pd.read_csv('../data/ETH-MCAP-TVL-ratios.csv')
plot(df3)